package lab01;

public class Test10 {
    public static void main(String[] args) {
        //打印正三角
        int ch='A';
        for(int i=1;i<=4;i++){
            for (int j=1;j<=4-i;j++){
                System.out.print(" ");
            }

            for (int n=1;n<=i;n++){
                char ch1=(char)ch;
                System.out.print(ch1+" ");
                ch++;
            }
            System.out.println();
        }

        //打印反三角
        int ch2='K';
        for (int k=1;k<=4;k++){       //控制所输出图形的最大列数
            for (int m=1;m<=k-1;m++){
                System.out.print(" ");  //在相应位置打印空格
            }

            for (int a=1;a<=5-k;a++){  //控制每行打印字母的个数
                char ch3=(char)ch2;
                System.out.print(ch3+" ");  //打印字母
                ch2++;
            }
            System.out.println();      //打印完一行后进行换行操作

        }
    }

}

